/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package device;

/**
 *
 * @author Kostya
 */
public class Device {
            
      private String manufacturer;
      private float price;
      private String serialNumber;

    public Device(String manufacturer, float price, String serialNumber) {
        this.manufacturer = manufacturer;
        this.price = price;
        this.serialNumber = serialNumber;

    }
    
      
    
    
    public String getManufacturer() {
        return manufacturer;
    }

    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    public String getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Device other = (Device) obj;
        if ((this.manufacturer == null) ? (other.manufacturer != null) : !this.manufacturer.equals(other.manufacturer)) {
            return false;
        }
        if (Float.floatToIntBits(this.price) != Float.floatToIntBits(other.price)) {
            return false;
        }
        if ((this.serialNumber == null) ? (other.serialNumber != null) : !this.serialNumber.equals(other.serialNumber)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 19 * hash + (this.manufacturer != null ? this.manufacturer.hashCode() : 0);
        hash = 19 * hash + Float.floatToIntBits(this.price);
        hash = 19 * hash + (this.serialNumber != null ? this.serialNumber.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "manufacturer=" + manufacturer + ", price=" + price + ", serialNumber=" + serialNumber;
    }

  public static void main(String[] args) {
        
      //  Device[] dev = new Device[2];
        Device[] dev = new Device[3];
     //   EthernetAdapter[] ea = new EthernetAdapter[2];
        dev[0] = new EthernetAdapter(1000,"12:34:56:78:90:10","Realtek",500.0f,"123qwe");
        dev[1] = new Monitor(1024,768,"LG",1200.0f,"321ewq");
        dev[2] = new Monitor(1024,768,"LG",1200.0f,"321ewq");
        
        if (dev[1].equals(dev[2])){
            System.out.println("Yeeee!!!!");
  }    else {
        System.out.println("Beeee!!!");
        }
        
        for(Device d : dev)
        {

            System.out.println(d);

        }
  }}